<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改任务信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-task-edit" th:object="${testerTask}">
            <input name="taskId" th:field="*{taskId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label" is-required>任务描述：</label>
                <div class="col-sm-8">
                    <input name="desc" th:field="*{desc}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label" is-required>主机：</label>
                <div class="col-sm-8">
                    <input name="host" th:field="*{host}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">端口：</label>
                <div class="col-sm-8">
                    <input name="port" th:field="*{port}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">登录配置</label>
                <div class="col-sm-8">
                    <select name="loginConfigId" class="form-control m-b">
                        <option value="">空</option>
                        <option th:each="loginConfig:${loginConfigs}" th:value="${loginConfig.loginConfigId}" th:text="${loginConfig.desc}" th:selected="${loginConfig.loginConfigId == testerTask.loginConfigId}" th:disabled="${loginConfig.status == '1'}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "tester/task";
        $("#form-task-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-task-edit').serialize());
            }
        }
    </script>
</body>
</html>
